export default function createPage(state, { that, pageName }) {
  if (pageName == "") {
    return that.$message({
      message: "请输入页面名称",
      type: "warning",
    });
  }
  if (state.page.tree[pageName]) {
    that.$message.error(`页面名为${pageName}的页面已存在`);
    return;
  }

  that.$set(state.page.tree, pageName, [
    {
      tagName: "div",
      attrs: {
        class: "fixedBox1621244787698",
        "data-type": "fixedBox",
      },
      style: {
        padding: "10px 10px 10px 10px",
        margin: "10px 10px 10px 10px",
        height: "400px",
      },
      children: [],
    },
  ]);
  that.$message({
    message: "页面创建成功",
    type: "success",
  });
}
